// 封装文章相关的接口
import axios from "../util/request";

// 获取文章列表接口
export function getArticle(params) {
  return axios({
    url: "/post",
    method: "get",
    params
  })
}

// 发布文章接口
export const publish = (data) => axios({ url: "/post", method: "post", data })

// 获取文章详情
export const articleDetail = (id) => axios({ url: "/post/" + id, })

// 编辑文章接口 /post_update/:id
export const post_update = (id, data) => {
  return axios({
    url: "/post_update/" + id,
    method: "post",
    data
  })
}